/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>
#include <cmath>
#include <typeinfo>
using namespace std;
int len(int N)
{
    int x=(int)sqrt(2.0*(N+1))-1;
    return x%2==0 ? x-1:x;
}
int main_1027()
{
    int N,bottom,temp;
    char c;
    scanf("%d %c",&N,&c);
    bottom=temp=len(N);
    for (int i=0;i<bottom/2 ; ++i)
    {
        for (int j=0;j<i ;++j )
        {
            printf(" ");
        }
        for (int k=0;k<temp ;++k )
        {
            printf("%c",c);
        }
        printf("\n");
        temp-=2;
    }
    temp=1;
    for (int i=bottom/2; i>=0; --i)
    {
        for (int j=0;j<i ; ++j)
        {
            printf(" ");
        }
        for (int k=0; k<temp;++k )
        {
            printf("%c",c);
        }
        temp+=2;
        printf("\n");
    }
    printf("%d",N-((bottom+1)*(bottom+1)/2-1));
	return 0;
}
